﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using ConfigurationFactory;
using DataCom;
using LineWatch.Common;

namespace DBAccessLib
{
    public abstract class Position
    {
        public static LinePositionModel GetAllLinePositions()
        {
            IPositionAccess access = DataCommunicationFactory.GetPositionAccess();
            return access.GetAllLinePositions();
        }

        public static bool SaveAllLinePositions(LinePositionModel model)
        {
            IPositionAccess access = DataCommunicationFactory.GetPositionAccess();
            return access.SaveAllLinePositions(model);
        }

        public static void UpdatePositionLogByKey(string lineCode,
                                                  string logDate,
                                                  string shift,
                                                  string logTime,
                                                  string type,
                                                  string sPositionID,
                                                  string fPositionID,
                                                  string stopTime,
                                                  string helpTime,
                                                  string alarmTime)
        {
            IPositionLogAccess positionAccess = DataCommunicationFactory.GetPositionLogAccess();
            positionAccess.UpdatePositionLogByKey(lineCode, logDate, shift, logTime, type, sPositionID, fPositionID, stopTime, helpTime, alarmTime);
        }

        public static void UpdatePositionLogTempByKey(string lineCode,
                                                      string logDate,
                                                      string shift,
                                                      string logTime,
                                                      string type,
                                                      string sPositionID,
                                                      string fPositionID,
                                                      string stopTime,
                                                      string helpTime,
                                                      string alarmTime)
        {
            IPositionLogAccess positionAccess = DataCommunicationFactory.GetPositionLogAccess();
            positionAccess.UpdatePositionLogTempByKey(lineCode, logDate, shift, logTime, type, sPositionID, fPositionID, stopTime, helpTime, alarmTime);
        }
    }
}
